package com.cw.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cw.annotation.NeedMerge;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author smq
 * @since 2021-04-28
 */
@ApiModel(value = "用户表")
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("SYS_USER")
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId("USER_ID")
    @NeedMerge()
    private String userId;

    /**
     * 账号
     */
    @ApiModelProperty(value = "用户名")
    @ExcelProperty(value = "USERNAME")
    @TableField("USERNAME")
    private String username;

    /**
     * 姓名
     */
    @ApiModelProperty(value = "真正名字")
    @ExcelProperty(value = "REALNAME")
    @TableField("REALNAME")
    private String realname;

    /**
     * 密码
     */
    @ApiModelProperty(value = "密码")
    @ExcelProperty(value = "PASSWORD")
    @TableField("PASSWORD")
    private String password;

    /**
     * 性别
     */

    @ApiModelProperty(value = "性别编码(1男 2女 0未知)")
    @ExcelProperty(value = "SEX_CODE")
    @TableField("SEX_CODE")
    private String sexCode;

    /**
     * 出生日期
     */

    @ApiModelProperty(value = "生日")
    @ExcelProperty(value = "BIRTHDAY")
    @TableField("BIRTHDAY")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime birthday;


    @ApiModelProperty(value = "科室编码")
    @ExcelProperty(value = "DEPT_CODE")
    @TableField("DEPT_CODE")
    private String deptCode;

    /**
     * 部门，即每一个科室
     */

    @ApiModelProperty(value = "部门科室名称")
    @ExcelProperty(value = "DEPT_NAME")
    @TableField("DEPT_NAME")
    private String deptName;

    @ApiModelProperty(value = "电话")
    @ExcelProperty(value = "PHONE")
    @TableField("PHONE")
    private String phone;

    @ApiModelProperty(value = "添加时间")
    @ExcelProperty(value = "CREATE_TIME")
    @TableField("CREATE_TIME")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    @ExcelProperty(value = "UPDATE_TIME")
    @TableField("UPDATE_TIME")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "删除标记 0未删 1已删")
    @ExcelProperty(value = "DEL_FLAG")
    @TableField("DEL_FLAG")
    private String delFlag;


    @ApiModelProperty(value = "0启用 1停用")
    @ExcelProperty(value = "ENABLE")
    @TableField("ENABLE")
    private String enable;

    @ApiModelProperty(value = "职务名称")
    @ExcelProperty(value = "DUTY_NAME")
    @TableField("DUTY_NAME")
    private String dutyName;

    @ApiModelProperty(value = "职务编号")
    @ExcelProperty(value = "DUTY_CODE")
    @TableField("DUTY_CODE")
    private String dutyCode;

    @ApiModelProperty(value = "角色ID")
    @ExcelProperty(value = "ROLE_CODE")
    @TableField("ROLE_CODE")
    private String roleCode;

    @ApiModelProperty(value = "角色名称")
    @ExcelProperty(value = "ROLE_NAME")
    @TableField("ROLE_NAME")
    private String roleName;

    @ApiModelProperty("是否第一次登录 0是 1否")
    @TableField("LOGIN_FIRST")
    private String loginFirst;

    @ApiModelProperty("工号")
    @TableField("EMPLOYEE_ID")
    private String employeeId;

    @ApiModelProperty("院区")
    @TableField("YARD")
    private String yard;


    @TableField(exist = false)
    private String newPassword;
}
